// Learn TypeScript:
//  - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html

import AbstractView, { Binding, ViewModel } from "../../../../../framework/base/mvvm/AbstractView";
import launch_view_model from "../../../scripts/launch_view_model";

const {ccclass, property} = cc._decorator;

@ccclass
/**
 * @ViewModel
 * @param moduleName 指定当前模块名
 * @param viewModel 指定一个viewModel
 * @param autoInjectCommands 默认为false 如果为true 会自动注入viewModel @Command 的方法到本对象中
 */
@ViewModel('launch', launch_view_model, true)
export default class launch_main extends AbstractView<launch_view_model> {

    @property(cc.ProgressBar) progressbar: cc.ProgressBar = null;

    // LIFE-CYCLE CALLBACKS:

    onLoad () {
        // this.bind('__progressEventData',this.__progressEventData);
        this.viewModel.initLaunch();
    }

    start () {

    }

    @Binding __progressEventData(value: number){
        console.log('progress', value);
        this.progressbar.progress = value;
    }
    // update (dt) {}
}
